#!/usr/bin/expect
set idcid [exec sh -c {rm -rf /root/.ssh/known_hosts}]
set user [lindex $argv 0]
spawn ssh root@$user
expect {
    -re "password" {send "Net@st&l\r"} 
    -re "yes/no" {send "yes\n";exp_continue} # 有的时候输入几次密码来确认,exp_continue
}
expect "*#"
interact
